﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GalaxyPresident
{
    class SendItemTask : SendTask
    {
        public SendItemTask(Planet source)
            : base(source)
        {
            name = "transport";
        }
        public override bool isAvailable(bool isOwner)
        {
            return isOwner && source!= target;
        }
        public override Microsoft.Xna.Framework.Color GetColor()
        {
            return PlayingScreen.BUTTON_COLOR_1;
        }

        public override void setCompleteSendTask()
        {       
            Target.Meterial += sendingInfo.Material;
            target.Energy += sendingInfo.Enegry;

            foreach (Unit unit in motherShip.Units)
            {
                target.Units.Add(unit);

                //TODO: set unit for visible on view
                //target.ViewLayer.AddChild(unit);
            }

            motherShip.Units.Clear();
        }
    }
}
